package org.hanyx.client;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import retrofit2.Retrofit;

import java.io.IOException;

@Component
public class HelloClient {

    private HelloService helloService;

    @Autowired
    public HelloClient(Retrofit retrofit) {
        this.helloService = retrofit.create(HelloService.class);
    }

    public String say1(String name) throws IOException {
        return helloService.say1(name).execute().body();
    }

    public String say2(String name) throws IOException {
        return helloService.say2(name).execute().body();
    }

    public String say3(String name) throws IOException {
        return helloService.say3(name).execute().body();
    }
}
